
<%@ include file="/common/taglibs.jsp"%>
<!--分页查询共用的页面-->
<%@ include file="/common/common.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<script type="text/javascript" src="<%=jsPath%>/jquery/jquery.timers.js"></script><!--定时器-->
<script type="text/javascript" src="<%=jsPath%>/terminalCommand.js"></script><!--终端命令结果查询-->


<script>

	/*
	修改代码：
	1.新定义变量TerminalCommmand，为命令支持变量
	2.重定义id：
	原：null		现：tvpCommandMsg
	原：null		现：tvpBtn
	原：		现：
	*/

	var tc2TerminalVideoProperty = new TerminalCommand2();
     var timerName = "TerminalVideoPropertyTimer";
	///////////////////////////////////////////////////////////////

	$().ready(function () {

		tc2TerminalVideoProperty.messageDiv = $("#tvpCommandMsg");
		tc2TerminalVideoProperty.timerName = timerName;
		tc2TerminalVideoProperty.commandButton = $("#tvpBtn");

		$("#tvpEntityForm").validate(); //初始化验证信息


		Utility.ajaxSubmitForm("tvpEntityForm", {
			success: function (responseText) {
				var result = responseText;
				if (result.success) {
					commandId = result.data; //下发成功后，获取到命令Id
					tc2TerminalVideoProperty.startQueryResult(commandId, null, onCommandSuccess);//命令下发成功,根据命令id,开始尝试获取检索结果
				}
				else {
					$("#tvpCommandMsg").html("提交失败! 错误原因：" + (result.message ? result.message : result.Data));
					//停止所有的在$('body')上定时器  
					$('body').stopTime(timerName);
				}
			}
		});
	});

    function  setTerminalVideoProperty(p) {
        $(".VideoProperty").each(function(i,v)
        {
            var id = this.id;
            var value = p[id];
            $(this).html(value);
        });
    }

    var commandId = 0;
    function onCommandSuccess()
    {
        var url = "<%=ApplicationPath%>/videoCommand/getTerminalVideoProperty.action";
        var param = {commandId:commandId};
        $.getJSON(url, param, function(result)
        {
            if(result.success)
            {
                var p = result.data;
                setTerminalVideoProperty(p);
            }else
            {
                $("#tvpCommandMsg").html(result.message);
            }
        });
    }


</script>
 <BODY>
	<form id="tvpEntityForm" name="tvpEntityForm" 
			action='<%=ApplicationPath%>/videoCommand/queryTerminalVideoProperty.action' method="POST">
				
        <input type="hidden"  name="vehicleId"  id="vehicleId" value="${vehicleId}"/>
  <table width="100%"  class="TableBlock">
					<tbody>
					<tr>

						<td colspan=2 align="center">
						   <input id="tvpBtn" type="submit" class="sendjson" value="查询">
						   <span id="tvpCommandMsg" class="commandMsg"></span></td>
						
					</tr>
					<tr>
						<td align="right" width="50%">输入音频编码方式
							:</td>
						<td class="VideoProperty" id="audioEcnoderType"></td>
					</tr>
					<tr>
						<td align="right">输入音频声道数:</td>
						<td class="VideoProperty" id="audioChannelNum"></td>
					</tr>
					<tr>
						<td align="right">输入音频采样率:</td>
						<td class="VideoProperty" id="audioFrequence"></td>
					</tr>
					<tr>
						<td align="right">输入音频采样位数:</td>
						<td class="VideoProperty" id="audioSampleBitNum"></td>
					</tr>
					<tr>
						<td align="right">音频帧长度:</td>
						<td class="VideoProperty" id="audioFrameLength"></td>
					</tr>
					<tr>
						<td align="right">是否支持音频输出:</td>
						<td class="VideoProperty" id="supportAudio"></td>
					</tr>
					<tr>
						<td align="right">视频编码格式:</td>
						<td class="VideoProperty" id="videoEncoderType"></td>
					</tr>
					<tr>
						<td align="right">终端支持的最大音频声道数:</td>
						<td class="VideoProperty" id="maxAudioChannelNum"></td>
					</tr>
					<tr>
						<td align="right">终端支持的最大视频通道数:</td>
						<td class="VideoProperty" id="maxVideoChannelNum"></td>
					</tr>

				
					
				</tbody></table>
				</form>
 </BODY>
</HTML>
